const jwt = require("jsonwebtoken");
const SECRET_KEY = "login2023";

// 生成token
function sign(u) {
  return jwt.sign({ user: { user_id: u.user_id, user_name: u.user_name, user_role: u.user_role } }, SECRET_KEY, {
    expiresIn: "48h",
  });
}

module.exports = sign;
